package org.arch_learn.dubbo_demo.service_consumer.service;

import org.apache.dubbo.config.annotation.Reference;
import org.arch_learn.dubbo_demo.api.HelloService;
import org.springframework.stereotype.Component;

@Component
public class HelloServiceConsumer {
//  @Reference(mock = "force:return null")//屏蔽（不发起调用）
    @Reference(loadbalance = "roundrobin",mock = "return null")//容错（发起调用失败后使用mock指定值返回）
//    @Reference(loadbalance = "consistenthash")
//    @Reference(loadbalance = "random")
//    @Reference(loadbalance = "leastactive")
//    @Reference(loadbalance = "onlyFirst")
    private HelloService helloService;

    public String sayHello(String name) {
        return helloService.sayHello(name);
    }
}
